import React, { Component } from 'react';
import '../Swiper/Swiper.scss'
import  service from '../../api'
import { Swiper } from 'antd-mobile'
class Swipe extends Component {
    constructor(props) {
        super(props)
        this.state = {
            Swpierlist: [
                {pic:'https://img1.baidu.com/it/u=2550386522,2209294955&fm=253&fmt=auto&app=120&f=JPEG?w=667&h=500'},
                {pic:'https://img2.baidu.com/it/u=1543069852,3684723126&fm=253&fmt=auto&app=138&f=JPEG?w=643&h=500'},
                {pic:'https://n.sinaimg.cn/sinacn/w640h392/20171220/c3cf-fypvuqe3785506.jpg'},
                {pic:'https://img2.baidu.com/it/u=2870860226,1713447382&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500'},
                {pic:'https://n.sinaimg.cn/sinacn/w531h394/20180117/11bd-fyqrewi9418092.png'},
                {pic:'https://img0.baidu.com/it/u=3399100144,3679976640&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281'},
            ],
        }
    }
    // async componentDidMount() {
    //     var res = await service.banner.user_banner()
    //     // console.log(res.data.data);
    //     this.setState({Swpierlist: res.data.data})
    // }
    render() {
        return (
            <div className='swiper'>
                <Swiper autoplay loop autoplayInterval={1000}>
                    {
                        this.state.Swpierlist.map((item, index) => {
                            return (
                                <Swiper.Item key={index}>
                                    <div className='img-box'>
                                        <img src={item.pic} alt="" />
                                    </div>
                                </Swiper.Item>
                            )
                        })
                    }
                </Swiper>
            </div>
        );
    }
}

export default Swipe;